import axios from './axios'

let instance = axios();
export default {
  get(url, params, headers) {
    let options = {};
    params && (options.params = params);
    headers && (options.headers = headers);
    return instance.get(url, options);
  },
  post(url, params, headers) {
    let options = {};
    headers && (options.headers = headers);
    return instance.post(url, params, options);
  },
  put(url, params, headers) {
    let options = {};
    headers && (options.headers = headers);
    return instance.put(url, params, options);
  },
  delete(url, params, headers) {
    let options = {};
    params && (options.params = params);
    headers && (options.headers = headers);
    return instance.delete(url, options);
  }
}